﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="../front.jsp"/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <link rel="stylesheet" type="text/css" href="style/css/index.css"/>
    <script type="text/javascript">
        // 通知服务员结账
        function pay(orderId, money) {
            alert('支付中，请稍等!');
            location.href = "${base}/pay?method=pay";
        }
    </script>
</head>

<body style="text-align: center">
<a href="${front}/detail/clientOrderList.jsp">订单</a>
<c:if test="${sessionScope.user == null}">
    <a href="${base}/user/login.jsp">登陆</a>
</c:if>
<c:if test="${sessionScope.user != null}">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    欢迎：
    ${sessionScope.user.userName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="${base}/user?method=userLogout">退出登陆</a>
</c:if>
<c:if test="${sessionScope.user != null}">
    <a href="${base}/order?method=findOrder">历史订单</a>
</c:if>


<div id="all">
    <div id="menu">
        <!-- 餐车div -->
        <div id="count">
            <table align="center" width="100%">
                <tr height="40">
                    <td align="center" width="20%">菜名</td>
                    <td align="center" width="20%">单价</td>
                    <td align="center" width="20%">数量</td>
                    <td align="center" width="20%">小计</td>
                </tr>

                <c:forEach items="${sessionScope.orderDetailsList}" var="orderDetails">
                    <tr height="60">
                        <td align="center" width="20%">${orderDetails.detailFoodName}</td>
                        <td align="center" width="20%">￥${orderDetails.detailPrice/100}</td>
                        <td align="center" width="20%">${orderDetails.detailNumber}</td>
                        <td align="center" width="20%">${orderDetails.detailTotalPrice/100.0}</td>
                    </tr>
                </c:forEach>

                <tr>
                    <td colspan="6" align="right">总计:
                        <span style="font-size:36px;">&yen;</span>
                        <label
                                id="counter" style="font-size:36px">${sessionScope.order.orderPrice/100.0}</label>
                    </td>
                </tr>
                <tr>
                    <td colspan="6" style="margin-left: 100px; text-align: center;" align="right">
                        <input type="hidden" name="bId" value="">
                        <c:if test="${sessionScope.order.orderPayStatus != 1}">
                            <input type="button" value="结账" class="btn_next" lang=""
                                   onclick="pay(${sessionScope.order.orderId}, ${sessionScope.order.orderPrice})"/>
                        </c:if>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <%--右边搜索框等--%>
    <div id="dish_class">
        <div id="dish_top">
            <ul>
                <li class="dish_num"></li>
                <li>
                    <a href="${front}/detail/clientCart.jsp">
                        <img src="${front}/detail/style/images/call2.gif"/>
                    </a>
                </li>
            </ul>
        </div>

        <div id="dish_2">
            <ul>
                <c:forEach items="${sessionScope.foodTypeList}" var="type">
                    <li>
                        <a href="${base}/front?method=findFoodToPage&foodTypeId=${type.typeId}&foodName=${foodName}">${type.typeName}</a>
                    </li>
                </c:forEach>

            </ul>
        </div>
        <div id="dish_3">
            <!-- 搜索菜品表单  -->
            <form action="${base}/front?method=findFoodToPage" method="post">
                <table width="166px">
                    <tr>
                        <td>
                            <span style="font-size: 20px">菜品名称:</span><input type="text" value="${foodName}"
                                                                             id="dish_name" name="foodName"
                                                                             class="select_value"/>
                            <%--<input type="hidden" value="selectFood" name="method">--%>
                        </td>
                    </tr>
                    <tr>
                        <td><input type="submit" id="sub" value=""/></td>
                    </tr>
                    <tr>
                        <td>
                            <a href="${base}/front?method=findFoodToPage">
                                <img src="${front}/detail/style/images/look.gif"/>
                            </a>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>

</div>
</body>
</html>
